﻿#ifndef LOGTABPANEL_H
#define LOGTABPANEL_H

#include <QWidget>
#include <QTabWidget>
#include <QTableWidget>
#include <QCheckBox>
#include <QDateTimeEdit>

#include "logqueue.h"
#include "searchentry.h"

#define LOAD_LOG_DEFAULT    7

class LogTabPanel : public QWidget
{
    Q_OBJECT
public:
    explicit LogTabPanel(QWidget *parent = nullptr, const LogQueue::LogType type = LogQueue::LogType::LogType_SoftRun);

private slots:
    void onDateTimeChanged();

    void onFilterStr();

    void onTextIsEmpty();

signals:

private:
    const LogQueue::LogType c_type;

    LogQueue        *m_logQueue;

    QDateTime       m_startDateTime, m_stopDateTime;   //!< 记录上一次时间, 判断点击控件后是否有修改
    QDateTimeEdit   *m_dtStart, *m_dtStop;
    QCheckBox       *m_chkCollect;
    SearchEntry     *m_searchEntry;
    QTableWidget    *m_tbwLogTable;

    void showAllTabWidget();
    void logTextSearch(const QStringList &strList);
};

#endif // LOGTABPANEL_H
